<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="stylesheet" href="/css/layui.css" th:href="@{/css/layui.css}" media="all">
</head>
<body>
<div style="margin: 15px">
    <shiro:user>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>欢迎您，
                <shiro:principal/>
            </legend>
        </fieldset>
        <div class="layui-btn-container">
            <shiro:hasPermission name="user:show"><a href="/user/show">
                <button type="button" class="layui-btn">显示用户信息</button>
            </a></shiro:hasPermission>
            <shiro:hasPermission name="user:delete"><a href="/user/delete">
                <button type="button" class="layui-btn layui-btn-danger">删除用户信息</button>
            </a></shiro:hasPermission>
            <a href="http://47.100.73.245:8080/demo/index.html">
                <button type="button" class="layui-btn">访问项目模板</button>
            </a>
            <a href="/user/logout" style="float: right">
                <button type="button" class="layui-btn layui-btn-warm">退出登录</button>
            </a>
        </div>
    </shiro:user>
    <shiro:guest>
        您还未登录，请<a href="/login">登录</a>
    </shiro:guest>
</div>
<script src="/js/layui.js" th:src="@{/js/layui.js}" charset="utf-8"></script>
</body>
</html>